package com.megan.design.principle.dependenceinversion;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author: megan
 * @Data: 2018/8/19 下午5:47
 * @Description:
 */
@Slf4j
public class Test {
    // v1
//    public static void main(String[] args) {
//        Megan megan = new Megan();
//        megan.studyJavaCourse();
//        megan.studyFeCourse();
//    }

    // v2
//    public static void main(String[] args) {
//        Megan megan = new Megan();
//        megan.studyCourse(new JavaCourse());
//        megan.studyCourse(new FeCourse());
//        megan.studyCourse(new PythonCourse());
//    }

    // v3
//    public static void main(String[] args) {
//        Megan megan = new Megan(new JavaCourse());
//        megan.studyCourse();
//    }

    //v4

    public static void main(String[] args) {
        Megan megan = new Megan();
        megan.setiCourse(new JavaCourse());
        megan.studyCourse();

        megan.setiCourse(new FeCourse());
        megan.studyCourse();

        megan.setiCourse(new PythonCourse());
        megan.studyCourse();
    }
}
